import type { TableColumn } from '@/framework/components/core/super-table';
import dayjs from 'dayjs';

export type TableListItem = {
  id: number | string;
  batchNo: string;
  keyword?: string;
  creatorId: string;
  name: string;
  createTime: string;
  commit: boolean;
};
export type TableColumnItem = TableColumn<TableListItem>;

export const baseColumns: TableColumnItem[] = [
  {
    title: '关键字',
    field: 'keyword',
    hideInTable: true,
  },
  {
    title: '审批单单号',
    field: 'batchNo',
    hideInSearch: true,
  },
  {
    title: '审批单名称',
    field: 'name',
    hideInSearch: true,
  },
  {
    title: '创建者',
    field: 'creatorId',
    hideInSearch: true,
  },

  {
    title: '创建时间',
    field: 'createTime',
    hideInSearch: true,
    formatter: ({ cellValue }) => {
      return cellValue ? dayjs(cellValue).format('YYYY-MM-DD') : '-';
    },
  },
];
